<!-- Generic page styles -->
<link rel="stylesheet" href="/jQuery-File-Upload-master/css/style.css">
<!-- CSS to style the file input field as button and adjust the Bootstrap progress bars -->
<link rel="stylesheet" href="/jQuery-File-Upload-master/css/jquery.fileupload-ui.css">
<link rel="stylesheet" href="/jQuery-File-Upload-master/css/bootstrap-image-gallery.min.css">
<noscript><link rel="stylesheet" href="/jQuery-File-Upload-master/css/jquery.fileupload-ui-noscript.css"></noscript>


<div class="span12">
    <h2>Create New Product</h2>
    <hr>
    <!-- The file upload form used as target for the file upload widget -->
    <form id="fileupload" action="http://localhost/upload" method="POST" enctype="multipart/form-data" onsubmit="return false">
        <legend>Images</legend>
        <!-- Redirect browsers with JavaScript disabled to the origin page -->
        <noscript><input type="hidden" name="redirect" value="/"></noscript>
        <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
        <div class="row fileupload-buttonbar">
            <div class="span7">
                <!-- The fileinput-button span is used to style the file input field as button -->
                <span class="btn btn-success fileinput-button">
                    <i class="icon-plus icon-white"></i>
                    <span>Add files...</span>
                    <input type="file" name="files[]" multiple>
                </span>
                <button type="submit" class="btn btn-primary start">
                    <i class="icon-upload icon-white"></i>
                    <span>Start upload</span>
                </button>
                <button type="reset" class="btn btn-warning cancel">
                    <i class="icon-ban-circle icon-white"></i>
                    <span>Cancel upload</span>
                </button>
                <button type="button" class="btn btn-danger delete">
                    <i class="icon-trash icon-white"></i>
                    <span>Delete</span>
                </button>
                <input type="checkbox" class="toggle">
                <!-- The loading indicator is shown during file processing -->
                <span class="fileupload-loading"></span>
            </div>
            <!-- The global progress information -->
            <div class="span5 fileupload-progress fade">
                <!-- The global progress bar -->
                <div class="progress progress-success progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100">
                    <div class="bar" style="width:0%;"></div>
                </div>
                <!-- The extended global progress information -->
                <div class="progress-extended">&nbsp;</div>
            </div>
        </div>
        <!-- The table listing the files available for upload/download -->
        <table role="presentation" class="table table-striped"><tbody class="files" data-toggle="modal-gallery" data-target="#modal-gallery"></tbody></table>
    </form>
    
<form class="form-horizontal" name="newProductForm" method="post" action="/product/new/json">
    
    <fieldset>
        <legend>Basic Properties</legend>
        <div class="control-group" >
            <label class="control-label" for="featureName">Product Name:</label>
            <div class="controls">
                <input type="text" id="featureName" placeholder="Product Name" required>
            </div>
        </div>

        <div class="control-group" >
            <label class="control-label" for="featureDesc">Description:</label>
            <div class="controls">
                <textarea rows="3" id="featureDesc" placeholder="Product description" required></textarea>
            </div>
        </div>

        <div class="control-group" >
            <label class="control-label" for="featureModel">Compatible Model:</label>
            <div class="controls">
                <select id="featureModel">
                </select>
                
            </div>
        </div>

         <div class="control-group"  >
            <label class="control-label" for="featureCBrand">Compatible Brand:</label>
            <div class="controls">
                <select id="featureCBrand">

                </select>
            </div>
        </div>

         <div class="control-group"  >
            <label class="control-label" for="featurePrice">Price:</label>
            <div class="controls" id="featurePrice">
                <input type="number" placeholder="Input the price">
                <select class="input-mini"></select>
            </div>
        </div>

         <div class="control-group"  >
            <label class="control-label" for="featureMaterial">Material:</label>
            <div class="controls" id="featureMaterial">
                <select ></select>
            </div>
        </div>

    </fieldset>

    <fieldset>
        <legend>Attributes</legend>

        <div class="control-group">
            <label class="control-label" for="attrName1" >Attribute Name:</label>
            <div class="controls">
                <input type="text" id="attrName1" placeholder="Attribute Name" required>
            </div>
            <label class="control-label" for="attrValue1" >Attribute Value:</label>
            <div class="controls">
                <input type="text" id="attrValue1" placeholder="Attribute Value" required>
            </div>
            <button class="btn align-right">Add</button>
        </div>

    </fieldset>


    <fieldset>
        <legend>Available Suppliers</legend>
        <div class="control-group">
            <label class="control-label" for="supplierName">Supplier Name</label>
            <div class="controls">
                <select id="supplierName"></select>
            </div>
        </div>
         <div class="control-group"  >
            <label class="control-label" for="featurePrice">Supplier Price:</label>
            <div class="controls" id="supplierPrice">
                <input type="number" placeholder="Input the price">
                <select class="input-mini"></select>
            </div>
        </div>
        <button class="btn align-right">Add</button>
    </fieldset>

    <div class="form-actions">
        <button type="submit" class="btn, btn-primary">Create</button>
    </div>
</form>
<script>
/*
function readURL(input){
    if (input.files && input.files[0]){
        var reader = new FileReader();
        reader.onload = function (e){
            //insert a image element
            var html = '<div class="span3">';
            html = html + '<br/><image src="' + e.target.result + '" alt="' + input.files[0] + '">';
            html = html + '<button class="btn btn-link">Remove</button>';
            html = html + '</div>';
            $(html).insertAfter('#images');
        }
        reader.readAsDataURL(input.files[0]);
    }
}*/
</script>
<!-- The template to display files available for upload -->
<script id="template-upload" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
    <tr class="template-upload fade">
        <td>
            <span class="preview"></span>
        </td>
        <td>
            <p class="name">{%=file.name%}</p>
            {% if (file.error) { %}
                <div><span class="label label-important">Error</span> {%=file.error%}</div>
            {% } %}
        </td>
        <td>
            <p class="size">{%=o.formatFileSize(file.size)%}</p>
            {% if (!o.files.error) { %}
                <div class="progress progress-success progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><div class="bar" style="width:0%;"></div></div>
            {% } %}
        </td>
        <td>
            {% if (!o.files.error && !i && !o.options.autoUpload) { %}
                <button class="btn btn-primary start">
                    <i class="icon-upload icon-white"></i>
                    <span>Start</span>
                </button>
            {% } %}
            {% if (!i) { %}
                <button class="btn btn-warning cancel">
                    <i class="icon-ban-circle icon-white"></i>
                    <span>Cancel</span>
                </button>
            {% } %}
        </td>
    </tr>
{% } %}
</script>
<!-- The template to display files available for download -->
<script id="template-download" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
    <tr class="template-download fade">
        <td>
            <span class="preview">
                {% if (file.thumbnail_url) { %}
                    <a href="{%=file.url%}" title="{%=file.name%}" data-gallery="gallery" download="{%=file.name%}"><img src="{%=file.thumbnail_url%}"></a>
                {% } %}
            </span>
        </td>
        <td>
            <p class="name">
                <a href="{%=file.url%}" title="{%=file.name%}" data-gallery="{%=file.thumbnail_url&&'gallery'%}" download="{%=file.name%}">{%=file.name%}</a>
            </p>
            {% if (file.error) { %}
                <div><span class="label label-important">Error</span> {%=file.error%}</div>
            {% } %}
        </td>
        <td>
            <span class="size">{%=o.formatFileSize(file.size)%}</span>
        </td>
        <td>
            <button class="btn btn-danger delete" data-type="{%=file.delete_type%}" data-url="{%=file.delete_url%}"{% if (file.delete_with_credentials) { %} data-xhr-fields='{"withCredentials":true}'{% } %}>
                <i class="icon-trash icon-white"></i>
                <span>Delete</span>
            </button>
            <input type="checkbox" name="delete" value="1" class="toggle">
        </td>
    </tr>
{% } %}
</script>
<!-- The jQuery UI widget factory, can be omitted if jQuery UI is already included -->
<script src="/jQuery-File-Upload-master/js/vendor/jquery.ui.widget.js"></script>
<!-- The Templates plugin is included to render the upload/download listings -->
<script src="/jQuery-File-Upload-master/js/vendor/tmpl.min.js"></script>
<script src="/jQuery-File-Upload-master/js/vendor/bootstrap-image-gallery.min.js"></script>

<!-- The Load Image plugin is included for the preview images and image resizing functionality -->
<script src="/jQuery-File-Upload-master/js/vendor/load-image.min.js"></script>
<!-- The Canvas to Blob plugin is included for image resizing functionality -->
<script src="/jQuery-File-Upload-master/js/vendor/canvas-to-blob.min.js"></script>


<!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
<script src="/jQuery-File-Upload-master/js/jquery.iframe-transport.js"></script>
<!-- The basic File Upload plugin -->
<script src="/jQuery-File-Upload-master/js/jquery.fileupload.js"></script>
<!-- The File Upload processing plugin -->
<script src="/jQuery-File-Upload-master/js/jquery.fileupload-process.js"></script>
<!-- The File Upload image resize plugin -->
<script src="/jQuery-File-Upload-master/js/jquery.fileupload-resize.js"></script>
<!-- The File Upload validation plugin -->
<script src="/jQuery-File-Upload-master/js/jquery.fileupload-validate.js"></script>
<!-- The File Upload user interface plugin -->
<script src="/jQuery-File-Upload-master/js/jquery.fileupload-ui.js"></script>
<!-- The main application script -->
<script src="/jQuery-File-Upload-master/js/main.js"></script>
<!-- The XDomainRequest Transport is included for cross-domain file deletion for IE8+ -->
<!--[if gte IE 8]><script src="js/cors/jquery.xdr-transport.js"></script><![endif]-->
</div>
